<template>
  <div class="app-container">
    <el-card class="box-card">
      <el-form ref="form" :model="form">
        <el-descriptions title="充装人信息" :column="2" border>
          <el-descriptions-item label="姓名" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">{{ form.name }}
          </el-descriptions-item>
          <el-descriptions-item label="工作单位" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_gas_station" :value="form.workPlace"/>
          </el-descriptions-item>
          <el-descriptions-item label="工号" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">{{ form.userName }}
          </el-descriptions-item>
        </el-descriptions>
        <br/>
        <el-descriptions title="钢瓶信息" :column="2" border>
          <el-descriptions-item label="钢瓶瓶号" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">{{ form.cylinderNumber }}
          </el-descriptions-item>
          <el-descriptions-item label="应充介质" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_medium" :value="form.gasMedia"/>
          </el-descriptions-item>
          <el-descriptions-item label="钢瓶状态" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_cylinder_status" :value="form.cylinderStatus"/>
          </el-descriptions-item>
          <el-descriptions-item label="所属气站" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_gas_station" :value="form.belongingGasStation"/>
          </el-descriptions-item>


        </el-descriptions>
        <el-descriptions title="气瓶充装前检查记录" :column="2" border>

          <el-descriptions-item label="下次检验日期" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">
            <span>{{ parseTime(form.nextInspectionDeadline, '{y}-{m}-{d}') }}</span>
          </el-descriptions-item>
          <el-descriptions-item label="瓶体外观检查" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_visual_inspertion" :value="form.visualInspertion"/>
          </el-descriptions-item>
          <el-descriptions-item label="涂色" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">{{ form.coloring }}
          </el-descriptions-item>
          <el-descriptions-item label="油污" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">{{ form.greasyDirt }}
          </el-descriptions-item>
          <el-descriptions-item label="余压" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">{{ form.residualPressure }}
          </el-descriptions-item>
          <el-descriptions-item label="不明气体分析" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">{{ form.unidentifiedGasAnalysis }}
          </el-descriptions-item>
          <el-descriptions-item label="出口螺纹样式" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_export_thread_style" :value="form.exportThreadStyle"/>
          </el-descriptions-item>
        </el-descriptions>
        <el-descriptions title="气瓶充装后检查记录" :column="2" border>
          <el-descriptions-item label="充装压力" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">{{ form.fillingPressure }}
          </el-descriptions-item>
          <el-descriptions-item label="密封情况" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_sealing_situation" :value="form.sealingSituation"/>
          </el-descriptions-item>
          <el-descriptions-item label="瓶体是否变形" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_deformation" :value="form.deformation"/>
          </el-descriptions-item>
          <el-descriptions-item label="瓶温异常情况" :span="1" label-class-name="my-label" :contentStyle='contentStyle'
                                :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_bottle_temperature_abnormalities"
                      :value="form.bottleTemperatureAbnormalities"/>
          </el-descriptions-item>
        </el-descriptions>
      </el-form>
      <br/>
      <div style="float:right; margin-bottom: 15px;">
        <el-button @click="viewCancel">返 回</el-button>
      </div>
    </el-card>
  </div>
</template>

<script>
import {getYinspection} from "@/api/module/yzx/yzx_yinspection";

export default {
  name: "Yinspection",
  dicts: ['yh_sealing_situation', 'yh_medium', 'yh_export_thread_style', 'yh_cylinder_status', 'yh_visual_inspertion', 'yh_bottle_temperature_abnormalities', 'sys_user_sex', 'yh_gas_station', 'yh_deformation', 'yh_posts'],
  data() {
    return {
      contentStyle: {
        'width': '550px',
      },
      labelStyle: {'width': '100px', 'color': '#000000', 'text-align': 'right',},
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: false,
      // 总条数
      total: 0,
      // 气瓶信息表格数据
      cylindersList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      open1: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        name: null,
        idNumber: null,
        workPlace: null,
        sex: null,
        userName: null,
        phone: null,
        posts: null,
        birth: null,
        cylinderNumber: null,
        cylinderStatus: null,
        gasMedia: null,
        weight: null,
        volume: null,
        belongingGasStation: null,
        manufactureDate: null,
        scrapDate: null,
        manufacturingUnits: null,
        nextInspectionDeadline: null,
        visualInspertion: null,
        coloring: null,
        greasyDirt: null,
        residualPressure: null,
        unidentifiedGasAnalysis: null,
        exportThreadStyle: null,
        fillingPressure: null,
        sealingSituation: null,
        deformation: null,
        bottleTemperatureAbnormalities: null,
        userId: null,
        deptId: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      },
      // 表单参数
      form: {},

    };
  },
  created() {
    const id = this.$route.query.id;
    if (id) {
      // 获取表详细信息

      getYinspection(id).then(res => {
        this.form = res.data;
      });
    }
  },
  methods: {
    viewCancel() {
      const id = this.$route.query.id;
      getYinspection(id).then(response => {
        this.form = response.data;

      });
      const obj = {path: "/qiping/yzxqpjc", query: {id}};
      this.$tab.closeOpenPage(obj);
    },
    /** 查询部门下拉树结构 */

  }
};
</script>
<style lang="scss" scoped>
</style>
